

#ifndef HELLOWORLDAO_STRUCT_H
#define HELLOWORLDAO_STRUCT_H

#include <stdint.h>
#include <string>
#include <iostream>
#include "libc2c/byte_stream.h"
#include "app_platform/intf_service_object.h"

namespace com
{
namespace erp
{
namespace test
{
namespace ao
{

	const uint32_t HELLOWORLDAO_SAYHELLO_REQ_CMD_ID = 0xc0281801; /// 请求命令号
	const uint32_t HELLOWORLDAO_SAYHELLO_RESP_CMD_ID = 0xc0288801; /// 回应命令号
	


const uint16_t HELLOWORLDAO_MAX_PROTOCAL_VERSION = 2; //>平台支持的最大协议版本号


///////////////////////////// STRUCTS /////////////////////////////////////////////////
	/**
	 *
 	 * 
	 *
 	 * @date 2013-09-30 17:49:47
 	 * @version 0
	 */	
	struct CHelloworldAoSayHelloReq : public IServiceObject, public ISerializableXML
	{
		std::string NickName;
		uint32_t Age;
	
	    virtual uint32_t getCmdId() const { return HELLOWORLDAO_SAYHELLO_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > HELLOWORLDAO_MAX_PROTOCAL_VERSION)
		    //    return false;
			bs & NickName;
		    return bs.isGood();
		}
		
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-09-30 17:49:47
 	 * @version 0
	 */	
	struct CHelloworldAoSayHelloResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		uint32_t Age;
		
	    virtual uint32_t getCmdId() const { return HELLOWORLDAO_SAYHELLO_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & Age;

		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};	

}
}
}
}

#endif /* HELLOWORLDAO_STRUCT_H */

